<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    
    <link rel="stylesheet" href="./layui.css">
</head>
<br>
    <input type="text" class="username layui-form-label">
   <input type="text" class="password layui-form-label">

</head>
<body>
    <input type="text" class="username">
    <input type="text" class="password">
    <input type="button" class="regist" value="注册" />

    <script src="../7月15日js系列周五/com.js"></script>
    <script>
        document.querySelector('.regist').addEventListener('click',()=>{
            let username = document.querySelector('.username').value;
            let password = document.querySelector('.password').value;
            ajax({
                url:'http://phpclub.org.cn/edu/server/regist.php',
                type:'post',
                data:{mobile:username,password},
                success: function(response){
              
                    if(response.code !=100){
                        alert(response.msg);
                        return;
                    }
                    location.href = 'login.html';
                }
            });
        })
    </script>
    <script src="./layui.js"></script>
</body>
</html>